{include file='common/head'}
<body>
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">演示</a>
        <a href="">
          <cite>转发</cite></a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">
    <div class="layui-row">
        <xblock>
            <button class="layui-btn" onclick="x_admin_show('添加转发','{:url(\'index/xinxi/zhuanfaadd\')}')"><i class="layui-icon"></i>添加转发</button>
            <a title="查看" href="{:url('index/xinxi/daochuzhuanfa')}" >
                <span class="layui-btn">导出数据</span>
            </a>
            <!--<button class="layui-btn" onclick="x_admin_show('导出数据','{:url(\'index/xinxi/daochu\')}')">导出数据</button>-->
            <span class="x-right" style="line-height:40px">共有数据：{$tiao} 条</span>
        </xblock>
    </div>
    <table class="layui-table">
        <thead>
        <tr>
            <th>NO</th>
            <th>转发ID</th>
            <th>转发人</th>
            <th>信息ID</th>
            <th>发布人</th>
            <th>转发时间</th>
        </thead>
        <tbody>
        {volist name="rs" id="rs"}
        <tr>
            <td>{$key+1}</td>
            <td>{$rs.id}</td>
            <td><a title="查看" href="javascript:;" attr_id='{$rs.zfid}' onclick="banner_edit_zhuanfa(this)">
                <span style="color: mediumblue">{if $rs.zfname==''}{$rs.znickname}{else/}{$rs.zfname}{/if}</span>
            </a></td>
            <td><a title="查看" href="javascript:;" attr_id='{$rs.mid}' onclick="banner_edit(this)">
                <span style="color: mediumblue">{$rs.mid}</span>
            </a></td>
            <td><a title="查看" href="javascript:;" attr_id='{$rs.fbid}' onclick="banner_edit_zhuanfa(this)">
                <span style="color: mediumblue">{if $rs.fbname==''}{$rs.fnickname}{else/}{$rs.fbname}{/if}</span>
            </a></td>
            <td>{$rs.z_createtime}</td>
        </tr>
        {/volist}
        </tbody>
    </table>
    <div class="page">
        <div>
            {$page}
        </div>
    </div>


</div>
<script>
    //转发人得查看
    function banner_edit_zhuanfa(obj){
        var mid=$(obj).attr('attr_id');
        //alert(mid);
        var url="{:Url('User/chakan')}?uid="+  mid;
        // alert(url);
        x_admin_show('查看',url);
    }
    //信息得查看
    function banner_edit(obj){
        var mid=$(obj).attr('attr_id');
        //alert(mid);
        var url="{:Url('xinxi/chakan')}?mid="+  mid;
        // alert(url);
        x_admin_show('查看',url);
    }
    layui.use('laydate', function(){
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#end' //指定元素
        });
    });

    /*用户-停用*/
    function member_stop(obj,id){
        layer.confirm('确认要停用吗？',function(index){

            $.ajax({
                url:'del',
                type:'POST',
                data:{'m_id':did},
                success:function(data){
                    //alert(data);
                    setTimeout(function(){  //使用  setTimeout（）方法设定定时2000毫秒
                        window.location.reload();//页面刷新
                    },500);                 },
                error:function(data){
                    //console.log(data);
                    alert('删除失败');
                }

            })
            layer.msg('已删除!',{icon:1,time:1000});
        });
    }

    function member_del(obj,did){
        layer.confirm('确认要删除吗？',function(index){
            //window.location.href="";
            //发异步删除数据
            $.ajax({
                url:'del',
                type:'POST',
                data:{'m_id':did},
                success:function(data){
                    //alert(data);
                    setTimeout(function(){  //使用  setTimeout（）方法设定定时2000毫秒
                        window.location.reload();//页面刷新
                    },500);                 },
                error:function(data){
                    //console.log(data);
                    alert('删除失败');
                }

            })

            //$(obj).parents("tr").remove();
            layer.msg('已删除!',{icon:1,time:1000});
        });
    }

    function delAll (argument) {

        var data = tableCheck.getData();

        layer.confirm('确认要删除吗？'+data,function(index){
            //捉到所有被选中的，发异步进行删除
            layer.msg('删除成功', {icon: 1});
            $(".layui-form-checked").not('.header').parents('tr').remove();
        });
    }
</script>

</body>

</html>